<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input id="file" type="file">
    <script>
        var file = document.querySelector('#file')
        
        file.onchange = function(e){
            console.log(this.files)
            const chunkSize = 1024 * 64 // 分片大小

            var file = this.files[0]
           

            // 分片
            var burst = []
            var start = 0, end = 0, index = 0;
            while(true){
                end += chunkSize
                var blob = file.slice(start, end)
                if(!blob.size) break; // 拆分结束
                burst.push({blob, index})
                index++
                start += chunkSize
            }
            console.log(burst)


        }

        
    </script>
</body>
</html>